export const RENDER_ORDER = {
    // Render opaque objects first.
    OPAQUE: 0,

    // Render the sky after all opaque object to save fill rate.
    SKY: 1,

    // Render transparent objects next so that the opaqe objects show through.
    TRANSPARENT: 2,

    // Finally render purely additive effects like pointer rays so that they
    // can render without depth mask.
    ADDITIVE: 3,

    // Render order will be picked based on the material properties.
    DEFAULT: 4,
};

class MaterialSampler {
    constructor(name, value) {
        this.name = name;
        this.texture = value;
    }
}

class MaterialUniform {
    constructor(name, value) {
        this.name = name;
        this.value = value;
    }
}

export class Material {
    constructor() {
        this.renderOrder = RENDER_ORDER.DEFAULT;
        this.samplers = [];
        this.uniforms = [];
    }

    defineSampler(name, value) {
        let sampler = new MaterialSampler(name, value);
        this.samplers.push(sampler);
        return sampler;
    }

    defineUniform(name, value) {
        let uniform = new MaterialUniform(name, value);
        this.uniforms.push(uniform);
        return uniform;
    }

    get name() {
        return null;
    }

    get vertexSource() {
        return null;
    }

    get fragmentSource() {
        return null;
    }
}  